home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ADSPSecure.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  3.7 KB  |  119 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ADSPSecure.p
  3.  
  4.      Contains:    Secure AppleTalk Data Stream Protocol Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ADSPSecure;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __ADSPSECURE__}
  27. {$SETC __ADSPSECURE__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ADSPSecureIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __ADSP__}
  37. {$I ADSP.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __OCEAUTHDIR__}
  40. {$I OCEAuthDir.p}
  41. {$ENDC}
  42.  
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. { New ADSP control codes
  49.  
  50.  * open a secure connection }
  51.  
  52. CONST
  53.     sdspOpen                    = 229;
  54.  
  55. {
  56. For secure connections, the eom field of ioParams contains two single-bit flags
  57. (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
  58. eom flag.  All other bits in that field should be zero.
  59.  
  60. To write an encrypted message, you must set an encrypt bit in the eom field of
  61. the ioParams of your write call. Note: this flag is only checked on the first
  62. write of a message (the first write on a connection, or the first write following
  63. a write with eom set.
  64. }
  65.     dspEOMBit                    = 0;                            {  set if EOM at end of write  }
  66.     dspEncryptBit                = 1;                            {  set to encrypt message  }
  67.  
  68.     dspEOMMask                    = $01;
  69.     dspEncryptMask                = $02;
  70.  
  71.  
  72. {
  73. Define an ADSPSecure parameter block, as used for the secure Open call.
  74.  
  75.  * size of ADSPSecure workspace }
  76.     sdspWorkSize                = 2048;
  77.  
  78.  
  79. TYPE
  80.     TRSecureParamsPtr = ^TRSecureParams;
  81.     TRSecureParams = RECORD
  82.         localCID:                UInt16;                                    {  local connection id  }
  83.         remoteCID:                UInt16;                                    {  remote connection id  }
  84.         remoteAddress:            AddrBlock;                                {  address of remote end  }
  85.         filterAddress:            AddrBlock;                                {  address filter  }
  86.         sendSeq:                UInt32;                                    {  local send sequence number  }
  87.         sendWindow:                UInt16;                                    {  send window size  }
  88.         recvSeq:                UInt32;                                    {  receive sequence number  }
  89.         attnSendSeq:            UInt32;                                    {  attention send sequence number  }
  90.         attnRecvSeq:            UInt32;                                    {  attention receive sequence number  }
  91.         ocMode:                    SInt8;                                    {  open connection mode  }
  92.         ocInterval:                SInt8;                                    {  open connection request retry interval  }
  93.         ocMaximum:                SInt8;                                    {  open connection request retry maximum  }
  94.         secure:                    BOOLEAN;                                {   --> TRUE if session was authenticated  }
  95.         sessionKey:                AuthKeyPtr;                                {  <--> encryption key for session  }
  96.         credentialsSize:        UInt32;                                    {   --> length of credentials  }
  97.         credentials:            Ptr;                                    {   --> pointer to credentials  }
  98.         workspace:                Ptr;                                    {   --> pointer to workspace for connection align on even boundary and length = sdspWorkSize  }
  99.         recipient:                AuthIdentity;                            {   --> identity of recipient (or initiator if active mode  }
  100.         issueTime:                UTCTime;                                {   --> when credentials were issued  }
  101.         expiry:                    UTCTime;                                {   --> when credentials expiry  }
  102.         initiator:                RecordIDPtr;                            {  <--  RecordID of initiator returned here. Must give appropriate Buffer to hold RecordID (Only for passive or accept mode)  }
  103.         hasIntermediary:        BOOLEAN;                                {  <--  will be set if credentials has an intermediary  }
  104.         filler1:                BOOLEAN;
  105.         intermediary:            RecordIDPtr;                            {  <--  RecordID of intermediary returned here. (If intermediary is found in credentials Must give appropriate Buffer to hold RecordID (Only for passive or accept mode)  }
  106.     END;
  107.  
  108.  
  109. {$ALIGN RESET}
  110. {$POP}
  111.  
  112. {$SETC UsingIncludes := ADSPSecureIncludes}
  113.  
  114. {$ENDC} {__ADSPSECURE__}
  115.  
  116. {$IFC NOT UsingIncludes}
  117.  END.
  118. {$ENDC}
  119.